package org.neurone.domain.persistence;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.neurone.domain.Message;
import org.neurone.domain.alter.MessageAlter;

/**
 * 消息
 * @author Administrator
 *
 */
@Entity
@Table(name="TMessage")
public class MessagePersistence extends MessageAlter implements java.io.Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 7376351845326391786L;

	@Override
	@Column(name="fromuser")
	public String getFrom() {
		// TODO Auto-generated method stub
		return super.getFrom();
	}

	@Override
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Long getMessageID() {
		// TODO Auto-generated method stub
		return super.getMessageID();
	}

	@Override
	@Column
	public String getMessageType() {
		// TODO Auto-generated method stub
		return super.getMessageType();
	}

	@Override
	@Column
	public Date getPostDate() {
		// TODO Auto-generated method stub
		return super.getPostDate();
	}

	@Override
	@Column
	public int getPriority() {
		// TODO Auto-generated method stub
		return super.getPriority();
	}

	@Override
	@Column
	public String getStatus() {
		// TODO Auto-generated method stub
		return super.getStatus();
	}

	@Override
	@Column(name="text")
	public String getText() {
		// TODO Auto-generated method stub
		return super.getText();
	}

	@Override
	@Column(name="touser")
	public String getTo() {
		// TODO Auto-generated method stub
		return super.getTo();
	}

	@Override
	@Column
	public String getTopic() {
		// TODO Auto-generated method stub
		return super.getTopic();
	}

	/* (non-Javadoc)
	 * @see org.neurone.domain.IMessage#getBelongToMessage()
	 */
	@Override
	@ManyToOne(targetEntity=MessagePersistence.class)
	public Message getBelongToMessage() {
		return belongToMessage;
	}
	@Override
	@OneToMany(mappedBy="belongToMessage",targetEntity=MessagePersistence.class)
	public List<Message> getReplyList() {
		return this.replyList;
	}

	public void setMessageID(Long messageID) {
		this.messageID = messageID;
	}

	public void setBelongToMessage(Message belongToMessage) {
		this.belongToMessage = belongToMessage;
	}

	public void setReplyList(List<Message> replyList) {
		this.replyList = replyList;
	}

	/* (non-Javadoc)
	 * @see org.neurone.domain.IMessage#isAvailable()
	 */
	@Column
	public boolean isAvailable() {
		return available;
	}

	
}
